/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jogs.client.games.bs;

import jogs.client.games.Card;

/**
 *
 * @author lanctot
 */
public class CardListener extends java.awt.event.MouseAdapter {

  private Card c;
  private BSPanel parent;
  private int x, y;
  private boolean selected;

  public CardListener(Card _c, BSPanel _parent, int _x, int _y)
  {
    c = _c;
    parent = _parent;
    x = _x; y = _y;
    selected = false;
  }

  public void mouseClicked(java.awt.event.MouseEvent evt) {
    System.out.println(c.toString());

    selected = !selected;

    if (!selected)
      parent.toggleSelected(c, x, y, selected);
    else if (selected)
      parent.toggleSelected(c, x, y-20, selected);
  }
}
